<?php
class ShippingRequest{
	public $country, $state, $postalcode;
	public $products;
	public $response_type;
	
	function ShippingRequest(){
		$this->response_type = 'ShippingResponse';
	}
	
	function getXML(){
		
		ob_start(); 
		?>
<ShippingOptions>
   	<Country><?php echo $this->country; ?></Country>
   	<State_Province><?php echo $this->state; ?></State_Province>
   	<PostalCode><?php echo $this->postalcode; ?></PostalCode>
   	<?php
   	foreach($this->products as $product){
   		?>
		<Product>
			<ProductId><?php echo $product->product_id; ?></ProductId>
			<Quantity><?php echo $product->quantity; ?></Quantity>
		</Product>
   		<?php
   	}
   	?>
</ShippingOptions> 	
	<?php
		$xml = ob_get_contents();
		ob_end_clean();
		return $xml;
	}
}
?>
